{extend name="layout/common_layout" /}
{block name="body"}
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class=""><a href="{:url('admin/user/index')}">用户管理</a></li>
            <li class=""><a href="{:url('admin/user/add')}">添加用户</a></li>
            <li class="layui-this">编辑用户</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <form class="layui-form form-container" action="{:url('admin/user/update')}" method="post">
                    <div class="layui-form-item">
                        <label class="layui-form-label">用户名</label>
                        <div class="layui-input-block">
                            <input type="text" name="username" value="{$user.username}" required  lay-verify="required" placeholder="请输入用户名" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">身份：</label>
                        <div class="layui-inline">
                            <select name="identity_id">
                                <option value=""></option>
                                {foreach name="identity_list" item="identity"}
                                <option value="{$identity.id}" {if condition="@$user['identity_id']==$identity['id']"}selected{/if}>{$identity.name}</option>
                                {/foreach}
                            </select>
                        </div>
                        <div class="layui-inline">
                            {if condition="$user['identity_id']>0"}
                            <span class='span-tip' style="color:{$identity_list[$user['identity_id']]['color']};background:{$identity_list[$user['identity_id']]['backcolor']}">{$identity_list[$user['identity_id']]['name']}</span>
                            {else /}
                            <span class='span-tip'>未认证</span>
                            {/if}
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">密码</label>
                        <div class="layui-input-block">
                            <input type="password" name="password" value="" placeholder="（选填）如不修改则留空" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">重复密码</label>
                        <div class="layui-input-block">
                            <input type="password" name="confirm_password" value="" placeholder="（选填）如不修改则留空" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">手机</label>
                        <div class="layui-input-block">
                            <input type="text" name="mobile" value="{$user.mobile}" placeholder="（选填）请输入手机" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">邮箱</label>
                        <div class="layui-input-block">
                            <input type="text" name="email" value="{$user.email}" placeholder="（选填）请输入邮箱" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">状态</label>
                        <div class="layui-input-block">
                            <input type="radio" name="status" value="1" title="启用" {if condition="$user.status==1"} checked="checked"{/if}>
                            <input type="radio" name="status" value="0" title="禁用" {if condition="$user.status==0"} checked="checked"{/if}>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <input type="hidden" name="id" value="{$user.id}">
                            <button class="layui-btn" lay-submit lay-filter="*">更新</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
{/block}